﻿<UserControl x:Class="Waf.InformationManager.AddressBook.Modules.Presentation.Views.ContactView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:dd="clr-namespace:Waf.InformationManager.AddressBook.Modules.Presentation.DesignData"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" d:DesignHeight="500" d:DesignWidth="300"
             d:DataContext="{d:DesignInstance dd:SampleContactViewModel, IsDesignTimeCreatable=True}">
    
    <Grid Margin="0,0,22,11">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="22"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <Label Content="_Firstname" Target="{Binding ElementName=firstnameBox}" Grid.Column="0" Grid.Row="0"/>
        <TextBox x:Name="firstnameBox" Text="{Binding Contact.Firstname, UpdateSourceTrigger=PropertyChanged, ValidatesOnExceptions=true, 
                     ValidatesOnDataErrors=true, NotifyOnValidationError=true}"
                 MaxLength="100" Grid.Column="1" HorizontalAlignment="Stretch"/>

        <Label Content="Lastname" Grid.Column="0" Grid.Row="1"/>
        <TextBox Text="{Binding Contact.Lastname, UpdateSourceTrigger=PropertyChanged, ValidatesOnExceptions=true, 
                     ValidatesOnDataErrors=true, NotifyOnValidationError=true}"
                 MaxLength="100" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Stretch"/>

        <Label Content="Company" Grid.Column="0" Grid.Row="2"/>
        <TextBox Text="{Binding Contact.Company, UpdateSourceTrigger=PropertyChanged, ValidatesOnExceptions=true, 
                     ValidatesOnDataErrors=true, NotifyOnValidationError=true}"
                 MaxLength="100" Grid.Column="1" Grid.Row="2" HorizontalAlignment="Stretch"/>
        
        <Label Content="Email" Grid.Column="0" Grid.Row="3"/>
        <TextBox Text="{Binding Contact.Email, UpdateSourceTrigger=PropertyChanged, ValidatesOnExceptions=true, 
                     ValidatesOnDataErrors=true, NotifyOnValidationError=true}"
                 MaxLength="100" Grid.Column="1" Grid.Row="3" HorizontalAlignment="Stretch"/>

        <Label Content="Phone" Grid.Column="0" Grid.Row="4"/>
        <TextBox Text="{Binding Contact.Phone, UpdateSourceTrigger=PropertyChanged, ValidatesOnExceptions=true, 
                     ValidatesOnDataErrors=true, NotifyOnValidationError=true}"
                 MaxLength="100" Grid.Column="1" Grid.Row="4" HorizontalAlignment="Stretch"/>

        <Label Content="Street" Grid.Column="0" Grid.Row="6"/>
        <TextBox Text="{Binding Contact.Address.Street, UpdateSourceTrigger=PropertyChanged, ValidatesOnExceptions=true, 
                     ValidatesOnDataErrors=true, NotifyOnValidationError=true}"
                 MaxLength="100" Grid.Column="1" Grid.Row="6" HorizontalAlignment="Stretch"/>

        <Label Content="City" Grid.Column="0" Grid.Row="7"/>
        <TextBox Text="{Binding Contact.Address.City, UpdateSourceTrigger=PropertyChanged, ValidatesOnExceptions=true, 
                     ValidatesOnDataErrors=true, NotifyOnValidationError=true}"
                 MaxLength="100" Grid.Column="1" Grid.Row="7" HorizontalAlignment="Stretch"/>

        <Label Content="State" Grid.Column="0" Grid.Row="8"/>
        <TextBox Text="{Binding Contact.Address.State, UpdateSourceTrigger=PropertyChanged, ValidatesOnExceptions=true, 
                     ValidatesOnDataErrors=true, NotifyOnValidationError=true}"
                 MaxLength="100" Grid.Column="1" Grid.Row="8" HorizontalAlignment="Stretch"/>

        <Label Content="Postal Code" Grid.Column="0" Grid.Row="9"/>
        <TextBox Text="{Binding Contact.Address.PostalCode, UpdateSourceTrigger=PropertyChanged, ValidatesOnExceptions=true, 
                     ValidatesOnDataErrors=true, NotifyOnValidationError=true}"
                 MaxLength="100" Grid.Column="1" Grid.Row="9" HorizontalAlignment="Stretch"/>

        <Label Content="Country" Grid.Column="0" Grid.Row="10"/>
        <TextBox Text="{Binding Contact.Address.Country, UpdateSourceTrigger=PropertyChanged, ValidatesOnExceptions=true, 
                     ValidatesOnDataErrors=true, NotifyOnValidationError=true}"
                 MaxLength="100" Grid.Column="1" Grid.Row="10" HorizontalAlignment="Stretch"/>
    </Grid>
</UserControl>
